<template>
  <div class="more">
    <nav>
      <div class="van" @click="ret">
<!--        <span class="iconfont icon-fanhui"></span>-->
        返回
      </div>
      <b>详细信息</b>
    </nav>
    <div class="cont" v-model="menuMsg">
      <p class="title">名称:{{menuMsg.dishName}}</p>
      <div class="img">
        <img :src="menuMsg.menuImg" width="100%"  />
      </div>
      <div class="account" v-show="menuMsg.instroduce!=null">
          介绍:{{menuMsg.instroduce}}
      </div>
<!--      <ul>-->
<!--          <li v-for="item in menuMsg.pinglunList">-->
<!--              <div class="pinglun">-->
<!--                    -->
<!--              </div>-->
<!--          </li>-->
<!--      </ul>-->
        <div>
            评论:
        </div>
        <van-card
                v-for="item in menuMsg.pinglunList"
        >
            <template #title>
                <van-icon name="https://b.yzcdn.cn/vant/icon-demo-1126.png" />
                {{item.usermonicker}}
                赞了该商品
            </template>
            <template #desc>
                <div>
                    &nbsp;&nbsp;&nbsp;&nbsp;{{item.say}}
                </div>
            </template>
            <template #footer>
                {{item.saytime}}
            </template>
        </van-card>
    </div>
  </div>
</template>

<script>
export default {
    data(){
        return{
            rid:"",
            menuMsg:{}
        }
    },
    created() {
        let rid = this.$route.params.rid;
        //console.log("rid====="+rid)
        let mid = this.$route.params.mid;
        //console.log("mid===="+mid);
        this.searchMenu(rid,mid);
        this.keepRid(rid);
    },
    methods: {
        ret() {
            this.$router.push({
                name: "menuList",
                params: { rid: this.rid },
            });
        },
        keepRid(rid){
           this.rid=rid;
           //console.log("rid===="+this.rid)
        },
        searchMenu(rid,mid){
            this.$http.post("/caipin/caipin/mselect?rid="+rid+"&mid="+mid).then(result=>{
                if(result.data.code===2000){
                    console.log(result.data.data)
                    this.menuMsg=result.data.data;
                }
            })
        }
    },
};
</script>

<style lang='less' scoped>
@import "../assets/css/iconfont.css";
nav {
  width: 100%;
  background-color: #f2473d;
  text-align: center;
  line-height: 0.4rem;
  color: white;
}
.van {
  position: absolute;
  width: 1rem;
  height: 0.4rem;
}
.iconfont {
  position: relative;
  top: -0.01rem;
  font-size: 0.3rem;
  color: rgba(0, 0, 0, 0.7);
  vertical-align: middle;
}
.cont {
  padding: 0 0.15rem;
  .title {
    margin: 0.2rem 0 0.3rem 0;
  }
  .img {
    width: 100%;
    /*height: 3rem;*/
    background-color: pink;
  }
  .account {
    width: 3.45rem;

    margin-top: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 9;
    -webkit-box-orient: vertical;
  }
}
</style>